<?php
/*
   Copyright 2010, Sanket Parab

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   
   This is a Test User Interface meant for demo purposes.
 */
require_once '../controller.php';
$g = new Group($params->g);
$students = $g->getAllStudents();
?>
<div class='group-info'>
<div class='group-data'>
	<p>Description: <?php print $g->description; ?></p>
	<p>Google Code URL: <a href='http://code.google.com/p/<?php print $g->code_name; ?>' target='_blank'><?php print $g->code_name; ?></a></p>
	<p>Google Groups URL: <a href='http://groups.google.com/group/<?php print $g->groups_name; ?>' target='_blank'><?php print $g->groups_name; ?></a></p>
</div>
<ul class='metrics'>
	<li><p><?php print $g->getSVNCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/svn.png"></li>
	<li><p><?php print $g->getWikiCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/wiki.png"></li>
	<li><p><?php print $g->getForumCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/forum.png"></li>
	<li><p><?php print $g->getFileCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/files.png"></li>
	<li><p><?php print $g->getIssueCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/issues.png"></li>
</ul>
<h3>Students:</h3>
<?php
if($students != null) {
	foreach($students as $s) {
?>
<div id='student-<?php print $s->id; ?>' class='student'>
	<div class='student-name clear'>
		<a href='#'><?php print $s->full_name; ?></a> (<a href='mailto:<?php print $s->email; ?>'><?php print $s->email; ?></a>)
	</div>
	<div class='student-options'>
		<a href='javascript: popup("modifystudent.php?s=<?php print $s->id; ?>")'>modify</a> |
		<a href='javascript: popup("deletestudent.php?s=<?php print $s->id; ?>")'>delete</a>
	</div>
	<ul class='metrics'>
		<li><p><?php print $s->getSVNCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/svn.png"></li>
		<li><p><?php print $s->getWikiCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/wiki.png"></li>
		<li><p><?php print $s->getForumCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/forum.png"></li>
		<li><p><?php print $s->getFileCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/files.png"></li>
		<li><p><?php print $s->getIssueCount(); ?></p><img src="<?php print HOST; ?>/includes/images/icons/issues.png"></li>
	</ul>
</div>
<?php
	}
} else {
?>
<div class='student'>
	<p>You haven't added any students yet.</p>
</div>
<?php
}
print button('add_student','Add Student',array('type'=>'button','onclick'=>"popup('addstudent.php?g=$g->id');",'class'=>'student'));
?>
</div>